#ifndef _DHT11_H
#define _DHT11_H

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "delay.h"


/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/  
#define DHT11_DAT_PORT		GPIOB
#define DTH11_DAT_PIN		GPIO_Pin_12


/* Exported macro ------------------------------------------------------------*/
#define DHT11_DAT_H		GPIO_SetBits(DHT11_DAT_PORT, DTH11_DAT_PIN)
#define DHT11_DAT_L		GPIO_ResetBits(DHT11_DAT_PORT, DTH11_DAT_PIN)
#define DHT11_DAT_R		GPIO_ReadInputDataBit(DHT11_DAT_PORT, DTH11_DAT_PIN)	


/* Exported variables ---------------------------------------------------------*/
extern uint8_t Temperature;
extern uint8_t Humidity;


/* Exported functions ------------------------------------------------------- */
void gpio_direction_output(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void gpio_direction_input(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void dht11_init(void);
int dht11_get_data(uint8_t *t, uint8_t *h);

#endif

